//
//  TSOpenUrlController.swift
//  TopStock
//
//  Created by dyd on 2017/11/5.
//  Copyright © 2017年 dyd. All rights reserved.
//

import UIKit

class TSOpenUrlController: UIViewController {
    var urlDic:NSDictionary? = nil
    @IBOutlet weak var webView: UIWebView!
    override func viewDidLoad() {
        super.viewDidLoad()
        
        var urlStr:String? = nil
        if urlDic != nil
        {
            let titleOptDic = urlDic?["titleOpt"] as! NSDictionary
            let middleDic = titleOptDic["middle"] as! NSDictionary
            let text = middleDic["text"] as? String
            self.title = text
            urlStr = urlDic?["url"] as? String
            if urlStr != nil{
                let url = NSURL(string: urlStr!)! as URL
                let request = URLRequest(url: url)
                webView.scrollView.bounces = false
                webView.scrollView.isScrollEnabled = false
                webView.scalesPageToFit = true
                webView.loadRequest(request)
            }
        }
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    @IBAction func dismissBackAction(_ sender: UIBarButtonItem)
    {
        self.dismiss(animated: true, completion: nil)
    }
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
